package com.ssy.lingxi.member.merchant.api.feign.paas;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.CountryCodeUpdateInsertVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;

/**
 * 国家代码接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-07-14
 */
@FeignClient(name = "merchant-member-service")
@RequestMapping("/paas/country")
public interface CountryCodeControllerFeign {

    /**
     * 根据枚举值定义，新增或更新国家代码
     * <p>枚举值定义在CountryCodeEnum中</p>
     * @param codeVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/code/update/insert", method = RequestMethod.POST)
    Wrapper<Void> updateOrInsertCountryCode(@RequestBody @Valid CountryCodeUpdateInsertVO codeVO);

    /**
     * 删除国家代码
     * @param codeVO 接口参数
     * @return 删除结果
     */
    @RequestMapping(value = "/code/delete", method = RequestMethod.POST)
    Wrapper<Void> deleteCountryCode(@RequestBody @Valid CountryCodeUpdateInsertVO codeVO);
}
